#include "twindow.h"
#include <qwt_plot_grid.h>
#include <iostream>
#include <qwt_plot_layout.h>
#include <qwt_scale_widget.h>
#include <qwt_scale_draw.h>

#include "TransAnalysis.h"

TWindow::TWindow()
    : m_TransPlot(QwtText("Rainbow"), this)
{
    setCentralWidget(&m_TransPlot);
    pack.setCallBack(this, &TWindow::addTransaction);
}

TWindow::~TWindow() {

}

/**
 * @brief TWindow::addTransaction Add Transaction to this plot.
 * @param transaction
 */
void TWindow::addTransaction(const Transaction &transaction) {
    m_TransPlot.addTransaction(transaction);
//    std::cout << __FILE__ << ", addtransaction, time = " << transaction.getTime() << std::endl;
}
